package com.sun.weekend.util;

import android.app.Activity;
import android.content.Context;
import android.view.WindowManager;

/**
 * @author sunleilei
 */

public class ScreenUtils {


    public static void hideStatusBar(Context context) {
        WindowManager.LayoutParams attrs = ((Activity)context).getWindow().getAttributes();
        attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
        ((Activity)context).getWindow().setAttributes(attrs);
    }

    public static  void showStatusBar(Context context) {
        WindowManager.LayoutParams attrs = ((Activity)context).getWindow().getAttributes();
        attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
        ((Activity)context).getWindow().setAttributes(attrs);
    }
}
